Document that inline completion requires text-column to be set.
authorMatthias Clasen <mclasen@redhat.com>
Tue, 15 Mar 2005 15:00:11 +0000 (15:00 +0000)
committerMatthias Clasen <matthiasc@src.gnome.org>
Tue, 15 Mar 2005 15:00:11 +0000 (15:00 +0000)
2005-03-15  Matthias Clasen  <mclasen@redhat.com>

* gtk/gtkentrycompletion.c (gtk_entry_completion_class_init):
Document that inline completion requires text-column to be set.
(gtk_entry_completion_compute_prefix): Return NULL if text-column
is not set.

* gtk/gtkentry.c (check_completion_callback): Call
gtk_entry_completion_complete() before inserting the prefix,
otherwise the prefix may depend on (random) state of the
filter model.

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-8
gtk/gtkentry.c
gtk/gtkentrycompletion.c

index 77366d3afdaeebdb583628c18061b39e405b5403..e6b0b27386677d8c31831e97a0e63d738be352a9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,15 @@
+2005-03-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): 
+       Document that inline completion requires text-column to be set.
+       (gtk_entry_completion_compute_prefix): Return NULL if text-column
+       is not set.
+
+       * gtk/gtkentry.c (check_completion_callback): Call 
+       gtk_entry_completion_complete() before inserting the prefix,
+       otherwise the prefix may depend on (random) state of the
+       filter model.  
+
 2005-03-15  Anders Carlsson  <andersca@imendio.com>
 
        * docs/iconcache.txt:
index 77366d3afdaeebdb583628c18061b39e405b5403..e6b0b27386677d8c31831e97a0e63d738be352a9 100644 (file)
@@ -1,3 +1,15 @@
+2005-03-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): 
+       Document that inline completion requires text-column to be set.
+       (gtk_entry_completion_compute_prefix): Return NULL if text-column
+       is not set.
+
+       * gtk/gtkentry.c (check_completion_callback): Call 
+       gtk_entry_completion_complete() before inserting the prefix,
+       otherwise the prefix may depend on (random) state of the
+       filter model.  
+
 2005-03-15  Anders Carlsson  <andersca@imendio.com>
 
        * docs/iconcache.txt:
index 77366d3afdaeebdb583628c18061b39e405b5403..e6b0b27386677d8c31831e97a0e63d738be352a9 100644 (file)
@@ -1,3 +1,15 @@
+2005-03-15  Matthias Clasen  <mclasen@redhat.com>
+
+       * gtk/gtkentrycompletion.c (gtk_entry_completion_class_init): 
+       Document that inline completion requires text-column to be set.
+       (gtk_entry_completion_compute_prefix): Return NULL if text-column
+       is not set.
+
+       * gtk/gtkentry.c (check_completion_callback): Call 
+       gtk_entry_completion_complete() before inserting the prefix,
+       otherwise the prefix may depend on (random) state of the
+       filter model.  
+
 2005-03-15  Anders Carlsson  <andersca@imendio.com>
 
        * docs/iconcache.txt:
index b26cdda5d454b87c19d8a8f92e4dcebdd35085d1..0659e12bf330576e1e8ca72fadb9e0e70f5e671e 100644 (file)
@@ -5200,6 +5200,7 @@ check_completion_callback (GtkEntryCompletion *completion)
 {
   completion->priv->check_completion_idle = NULL;
   
+  gtk_entry_completion_complete (completion);
   gtk_entry_completion_insert_prefix (completion);
 
   return FALSE;
index 4a9028d5e1929825bb3d12f9e13c585437468419..9672e48317cffb03aa527a3493268257ff4ecec8 100644 (file)
@@ -303,7 +303,9 @@ gtk_entry_completion_class_init (GtkEntryCompletionClass *klass)
    * GtkEntryCompletion:inline-completion:
    * 
    * Determines whether the common prefix of the possible completions 
-   * should be inserted automatically in the entry.
+   * should be inserted automatically in the entry. Note that this
+   * requires text-column to be set, even if you are using a custom
+   * match function.
    *
    * Since: 2.6
    **/
@@ -1412,8 +1414,12 @@ gtk_entry_completion_compute_prefix (GtkEntryCompletion *completion)
   GtkTreeIter iter;
   gchar *prefix = NULL;
   gboolean valid;
+  const gchar *key;
 
-  const gchar *key = gtk_entry_get_text (GTK_ENTRY (completion->priv->entry));
+  if (completion->priv->text_column < 0)
+    return NULL;
+
+  key = gtk_entry_get_text (GTK_ENTRY (completion->priv->entry));
 
   valid = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (completion->priv->filter_model),
                                         &iter);